package com.longsichao.lscframe.app;

import android.app.ProgressDialog;
import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.View.OnClickListener;

import com.longsichao.lscframe.model.LSCModel;

/**
 * @author SONG GUANYULONGSICHAO (leo.song[at]outlook[dot]com)
 */
public class LSCv4Fragment extends Fragment implements OnClickListener, LSCModel.OnModelListener {
    private static ProgressDialog mProgressDialog;

    protected void showProgressDialog(@StringRes int resId) {
        if (mProgressDialog != null) {
            mProgressDialog.dismiss();
        }
        mProgressDialog = ProgressDialog.show(getActivity(), "", getString(resId));
    }

    protected void dismissProgressDialog() {
        if (mProgressDialog != null && mProgressDialog.isShowing()) {
            mProgressDialog.dismiss();
        }
    }

    @Override
    public void onClick(View v) {
        // 控件点击事件
    }

    @Override
    public boolean onModel(int caseId, LSCModel model) {
        // 数据加载回调函数
        return false;
    }
}
